import java.util.ArrayList;
// класс-корабль
public class Ship
{
	private ArrayList<String> coords = new ArrayList<String>();
	private ArrayList<String> shotCoords = new ArrayList<String>();
	private int decks = 0;
	
	public Ship() {};
	
	public Ship(String coord)
	{
		System.out.println("A new ship has been build!!! Its coord is - " + coord);
		setCoord(coord);
	}
	
	public void setCoord(String coord)
	{
		coords.add(coord);
		decks++;
	}
	
	public ArrayList<String> getCoords()
	{
		return coords;
	}
	
	public ArrayList<String> getShotCoords()
	{
		return shotCoords;
	}
	
	public int getDecks()
	{
		return decks;
	}
	
	public int removeCoord(String coord)
	{
		for (String coord1 : coords)
		{
			System.out.println(coord1 + " --> " + coord);
			System.out.println(" --- ");
		}
		
		if (coords.contains(coord)) 
		{
			coords.remove(coord);
			decks--;
			System.out.println("<<<<++++ GoT It +>>>>>");
			
			return 1;
		}
		else 
		{
			return 0;
		}
	}
	
	public int shot(String coord)
	{
		shotCoords.add(coord);
		int result = removeCoord(coord);
		
		if (coords.isEmpty())
		{
			System.out.println("sunk");
			return -1;
		}
		else
		{
			System.out.println("not sunk");
			return result;
		}
	}
}